Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@polkadot/util

Package Overview
Dependencies
Maintainers
1
Versions
1411
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polkadot/util

A collection of useful utilities for @polkadot

  • 0.32.23
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@polkadot/util

Various useful utility functions that are used across all projects in the @polkadot namespace. It provides utility functions with additional safety checks, allowing not only for consistent coding, but also reducing the general boilerplate.

Usage

Installation -

yarn add @polkadot/util

Functions can be imported directly from the package, e.g.

import { isHex } from '@polkadot/util';

Documentation and Available Utilities

Below is a list of currently exposed methods published at the Polkadot-JS Common Documentation Portal.

Utility methods for this package are split into groups, some of which are included in the list below:

Below is information about some of the available methods:

Assert

  • Checks for a valid test, if not ExtError is thrown

Logger

  • Creates a consistent log interface for messages that has .log, .error, .warn and .debug (controlled with environment DEBUG=typeA,typeB) methods.

Promisify

  • Wraps a supplied asynchronous callback function into a Promise, passing supplied parameters. When error is set, the Promise is rejected, else the Promise resolves with the result value.

Syncify

  • This is currently for Node environments only.

Keywords

FAQs

Package last updated on 21 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc